home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 101-125 / disk_114 / cdecl / cdecl.man < prev    next >
Text File  |  1992-05-06  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4.      CCCCDDDDEEEECCCCLLLL((((1111))))                 SSSSYYYYSSSSTTTTEEEEMMMM VVVV////66668888 3333....1111                 CCCCDDDDEEEECCCCLLLL((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           cdecl - Compose C declarations
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ccccddddeeeeccccllll
  13.  
  14.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.           _C_d_e_c_l is a program for encoding and decoding C type-
  16.           declarations.  It reads standard input for statements in the
  17.           language described below.  The results are written on
  18.           standard output.
  19.  
  20.           _C_d_e_c_l'_s scope is intentionally small.  It doesn't help you
  21.           figure out storage classes or initializations.
  22.  
  23.      CCCCOOOOMMMMMMMMAAAANNNNDDDD LLLLAAAANNNNGGGGUUUUAAAAGGGGEEEE
  24.           There are four statements in the language.  The "declare"
  25.           statement composes a C type-declaration from a verbose
  26.           description.  The "cast" statement composes a C type-cast as
  27.           might appear in an expression.  The "explain" statement
  28.           decodes a C type-declaration, producing a verbose
  29.           description.  The "help" statement describes the others.
  30.  
  31.           The following grammar describes the language.  In the
  32.           grammar, words in "<>" are non-terminals, bare lower-case
  33.           words are terminals that stand for themselves.  Bare upper-
  34.           case words are other lexical tokens: NOTHING means the empty
  35.           string; NAME means a C identifier; NUMBER means a string of
  36.           decimal digits; and NL means the new-line character.
  37.  
  38.           <program>    ::= NOTHING
  39.                          | <program> <stat> NL
  40.           <stat>       ::= NOTHING
  41.                          | declare NAME as <decl>
  42.                          | cast NAME into <decl>
  43.                          | explain <cdecl>
  44.                          | help
  45.           <decl>       ::= array of <decl>
  46.                          | array NUMBER of <decl>
  47.                          | function returning <decl>
  48.                          | function ( NAME ) returning <decl>
  49.                          | pointer to <decl>
  50.                          | <type>
  51.           <cdecl>      ::= <cdecl1>
  52.                          | * <cdecl>
  53.           <cdecl1>     ::= <cdecl1> ( )
  54.                          | <cdecl1> [ ]
  55.                          | <cdecl1> [ NUMBER ]
  56.                          | ( <cdecl> )
  57.                          | NAME
  58.           <type>       ::= <typename> | <modlist>
  59.                          | <modlist> <typename>
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 11/22/87)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      CCCCDDDDEEEECCCCLLLL((((1111))))                 SSSSYYYYSSSSTTTTEEEEMMMM VVVV////66668888 3333....1111                 CCCCDDDDEEEECCCCLLLL((((1111))))
  71.  
  72.  
  73.  
  74.                          | struct NAME | union NAME | enum NAME
  75.           <typename>   ::= int | char | double | float
  76.           <modlist>    ::= <modifier> | <modlist> <modifier>
  77.           <modifier>   ::= short | long | unsigned
  78.  
  79.      EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  80.           To declare an array of pointers to functions like malloc(3),
  81.           do declare fptab as array of pointer to function returning
  82.           pointer to char The result of this command is char
  83.           *(*fptab[])() When you see this declaration in someone
  84.           else's code, you can make sense out of it by doing explain
  85.           char *(*fptab[])() The proper declaration for signal(2)
  86.           cannot be described in _c_d_e_c_l's language (it can't be
  87.           described in C either).  An adequate declaration for most
  88.           purposes is given by declare signal as function returning
  89.           pointer to function returning int The function declaration
  90.           that results has two sets of empty parentheses.  The author
  91.           of such a function might wonder where the parameters go.
  92.           declare signal as function (args) returning pointer to
  93.           function returning int provides the solution: int
  94.           (*signal(args))()
  95.  
  96.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  97.           The declare statement tries to point out constructions that
  98.           are not supported in C.  Also, certain non-portable
  99.           constructs are flagged.
  100.  
  101.           Syntax errors cause the parser to play dead until a newline
  102.           is read.
  103.  
  104.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  105.           Section 8.4 of the C Reference Manual.
  106.  
  107.      BBBBUUUUGGGGSSSS
  108.           The pseudo-English syntax is excessively verbose.
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                         (printed 11/22/87)
  130.  
  131.  
  132.  
  133.